<script>
import { setToken } from "@/utils/auth";

export default {
  onLaunch: function () {
    console.log("App Launch");
  },
  onShow: function () {
    const query = this.$route.query;
    if (!(query && query.hasOwnProperty("app_token"))) {
      this.$showMessage({
        op: "message",
        type: "error",
        content: "无token，请退出重试",
      });
      // uni.showToast({
      //   icon: "error",
      //   title: "无token，请退出重试",
      // });
    } else {
      setToken(query.app_token);
    }
    console.log("App Show");
  },
  onHide: function () {
    console.log("App Hide");
  },
};
</script>

<style lang="scss">
body {
  font-size: 14px;
}
/*每个页面公共css */
@import "uview-ui/index.scss";
</style>
